var m_Stock;
 
var bLine, bOHLC,bCandle;

$(document).ready(function() { 
		$("#drawGraph").click(function(event){
			bLine=  bOHLC =bCandle = false;
			drawGraph();
	});
		$("#tabs").click(function(event){
			plotGraph();
		});
		
});

function drawGraph(){
	readStockInfor();
}

 
function readStockInfor(){
 var stockName = $('#txtStockName').val();
 var walletName = $('#txtWalletName').val();
 var atrBaseLine = $('#atrBaseline').val();
 
	$.ajax({
		url : "http://localhost:8080/Equity_Curve_Analyse/Servlet",
        type: "POST",
        data: 'stockName=' + stockName + '&walletName=' + walletName +'&atrBaseLine='+atrBaseLine,
        error: function(){
            alert("Data Error");
        },
        success: function (data){
        	m_Stock = data;
        	plotGraph(data);
        }
    }); 
}

